import { NgModule } from '@angular/core';
import { Ng2SmartTableModule } from 'ng2-smart-table';

import { ThemeModule } from '../../@theme/theme.module';
import { ExamRoutingModule, routedComponents } from './exam-routing.module';
import { BasicService } from '../../@core/data/basic.service';
import { NotificationsService } from '../../@core/utils/notifications.service';
import { ToasterModule } from 'angular2-toaster';
import { SweetAlert2Module } from '@toverux/ngx-sweetalert2';
// 计时器
import { CountdownModule } from 'ngx-countdown';
import { FileUploadModule } from 'ng2-file-upload';
import { StatisticsLineComponent } from './statistics/statistics-line.component';
import { StatisticsBarComponent } from './statistics/statistics-bar.component';
import { StatisticsMultipleXaxisComponent } from './statistics/statistics-multiple-xaxis.component';
import { StatisticsRadarComponent } from './statistics/statistics-radar.component';
import { StatisticsBarAnimationComponent } from './statistics/statistics-bar-animation.component';
import { StatisticsPieComponent } from './statistics/statistics-pie.component';
import { StatisticsAreaStackComponent } from './statistics/statistics-area-stack.component';
// echarts
import { NgxEchartsModule } from 'ngx-echarts';
// modal
import { QuestionModalComponent } from './question/modal/question.modal.component';
// rich text
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
import { PreviewqComponent } from './previewq/previewq.component';
import { PaperModalComponent } from './paper/modal/paper.modal.component';
import { QbankModalComponent } from './qbank/modal/qbank.modal.component';
import { AchievementModalComponent } from './achievement/modal/achievement.modal.component';
// 日期插件
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
// i18n
import { defineLocale } from 'ngx-bootstrap/bs-moment';
import { zhCn } from 'ngx-bootstrap/locale';
defineLocale('zh-cn', zhCn);
const examComponents = [
  StatisticsLineComponent,
  StatisticsPieComponent,
  StatisticsBarComponent,
  StatisticsMultipleXaxisComponent,
  StatisticsAreaStackComponent,
  StatisticsBarAnimationComponent,
  StatisticsRadarComponent,
  QuestionModalComponent,
  PreviewqComponent,
  PaperModalComponent,
  QbankModalComponent,
  AchievementModalComponent,
];

const entryComponents = [
  QuestionModalComponent,
  PaperModalComponent,
  QbankModalComponent,
  AchievementModalComponent,
];

@NgModule({
  imports: [
    ThemeModule,
    ExamRoutingModule,
    Ng2SmartTableModule,
    ToasterModule,
    SweetAlert2Module.forRoot({
      type: 'warning',
      // background: '#554db3',
      showCancelButton: true,
      confirmButtonText: '确认',
      cancelButtonText: '取消',
    }),
    CountdownModule,
    FileUploadModule,
    NgxEchartsModule,
    FroalaEditorModule.forRoot(),
    FroalaViewModule.forRoot(),
    BsDatepickerModule.forRoot(),
  ],
  declarations: [
    ...routedComponents,
    ...examComponents,
  ],
  providers: [
    BasicService,
    NotificationsService,
  ],
  entryComponents: [
    ...entryComponents,
  ],
})
export class ExamModule { }
